/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import hibernate.dao.Login;

/**
 *
 * @author Felipe
 */
public class UserSession {    
    
    private static UserSession sUserSession = null;
    private Login mUser;
    
    private UserSession() {
        mUser = null;
    }
    
    public void beginSession(Login pUser) {
        mUser = pUser;
    }
    
    public void endSession() {
        mUser = null;
    }
    
    public boolean hasUser() {
        return (mUser != null);
    }
    
    public static UserSession getInstance() {
        return (sUserSession == null) ? sUserSession = new UserSession() : sUserSession;
    }
    
}